package com.cheer.param;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Future;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
@ApiModel("新增修改param")
public class MallProductBookStoreParam {

    @ApiModelProperty("预订主键值")
    private Long id;
    /**
     * 商品ID
     */
    @ApiModelProperty("产品ID值")
    @NotNull(message = "预订产品ID值不能为空")
    private Long productId;

    /**
     * 要预先添加的产品的数量
     */
    @ApiModelProperty("预订产品数量")
    @Range(min = 1, max = 9999, message = "产品数量最少是 1 最大值为 9999")
    @NotNull(message = "产品数量不能为空")
    private Integer bookNum;
    /**
     * 预订时间
     */
    @ApiModelProperty("预订日期")
    @Future(message = "预订日期必须大于当前日期")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "预定日期不能为空")
    private Date bookDate;

}
